<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>事项查询</title>
    
	<%@ include file="/main/main_css.jsp" %>
    <%@ include file="/main/main_js.jsp" %>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="JS/main.js"></script>
	<style>
	   .cusp{
	   	float: left;width:20%;text-align:center;
	   	font-size: 20px;
	   	margin-bottom: 10px;
	   }
	   .ser-tit{
	   		color: #999;
  		    border-bottom: 1px dashed #999;
    		padding-bottom: 15px;
	   }
	</style>
  </head>
  
  <body onselectstart="return false">
    <div class="all-wrapper">
        <div class="row com-header text-center">
            <span>鹰潭市行政服务中心</span>
        </div>
        <div class="row main-content process-query">
        	<div class="row" >
                <div class="time-count pull-right">
                   <span>剩余</span> <span id="time" class="text-red"></span> <span>秒</span>
                </div>
            </div>
            <div class="col-md-24">
                <h1>事项查询</h1>
            </div>
            <form class="form-horizontal">
            	<div class="row">
                	<div class="col-md-24" >
                    	<div class="form-group form-group-lg">
                            <div class="col-md-8 col-md-offset-8">
	                            <input id="tagname" name="" type="text" class="form-control input-lg" placeholder="请输入事项名称">
	                        </div>
	                        <div class="col-md-6">
	                        	&nbsp;&nbsp;&nbsp;<button id="subForm" class="btn btn-primary btn-lg" style="height:60px;width: 100px;" type="button">查询</button>
	                        </div>
	                        
                        </div>
                    </div>
                </div>
                <div class="col-md-24">
	                <h1 class="ser-tit">分类搜索</h1>
	            </div>
                <c:forEach var="items" items="${oritems}">
                        <a class="col-md-3 cusp" style="float: left;width:20%;text-align:center;" href="/smartTerminal/getitembytagid?type=${type }&tag_name=${items.getTAG_NAME()}&tag_id=${items.getTAG_ID()}&itemName=&currentpage=1&pagesize=3">
                            <div class="list-sel-btn">
                            	 <div class="image-wrapper">
	                                <span style="color: black;">${items.getTAG_NAME()}</span>
                                </div>
                            </div>
                        </a>
                    </c:forEach>   
            </form>
        </div>
        <div class="row footer">
            <a class="btn btn-success btn-lg" href="loginOut" role="button"><i class="fa fa-reply"></i>返回首页</a>
        </div>
    </div>
    <form id="itemForm" action="getItemPageforName" method="post">
    	<input type="hidden" id="currentpage" name="currentpage" value="1">
    	<input type="hidden" id="pagesize" name="pagesize" value="3">
    	<input type="hidden" id="itemName" name="itemName">
    </form>
    <form id="loginOut" action="loginOut"></form>
    <script>
	  	//加入倒计时
		var count =  119;
		function countdown(){
			$("#time").text(count);
			if(count > 0){
				window.setTimeout("countdown()",1000);
				count --;
			}else{
				$("#loginOut").submit();
			}
		}
		countdown();
    
    
    	$("#subForm").click(function (){
    		$("#itemName").val($("#tagname").val());
    		$("#itemForm").submit();
    	});
    	
    	$("#tagname").on("click",function(){
    		var info = $("#tagname").val();
    	    var test = { 'info': info, 'ispassword': 0 };
    	    var data = JSON.stringify(test);
    	    send_command(
    	        "imewrite", data,
    	        function (receivedData) {
    	            var data = JSON.parse(receivedData);
    	            $("#tagname").val(data.msg);
    	        }
    	    );
    	});
    	
    	var winH = $(document).height();
        var mainH = winH -170;
        $('.main-content').height(mainH);
    </script>
  </body>
</html>
